package org.tong.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.tong.interceptors.LogHandlerInterceptor;

@Configuration
public class LogConfig extends WebMvcConfigurationSupport {

    @Autowired
    private LogHandlerInterceptor handlerInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        super.addInterceptors(registry);
        registry.addInterceptor(handlerInterceptor);
    }
}
